package kxfang.com.common.bean;

import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;

import kxfang.com.common.utils.MyUtils;


/**
 * 优惠券
 */
public class CouponModel implements Parcelable {
    private String ID;
    private String PicUrl;
    private String CardName;// 卡名称
    private String ValiDate;
    private String LowPrice;//面值
    private String SalePrice;//售价
    private String CMemo;
    private int RUserID;
    private String CompanyID;
    private String IndustryType;
    private String MainTypes;
    private String Cstate;//卡状态 1 全部 2 即将过期 3 已过期 ,
    private String RemainDay;
    private String FullReduce;//券使用条件
    private String Label;
    private String AppointMent;
    private String CardNo;
    private String ReceiveStatu;//领取状态 0 未领 1 已领
    private boolean isCheck = false;// 不是后台返回


    protected CouponModel(Parcel in) {
        ID = in.readString();
        PicUrl = in.readString();
        CardName = in.readString();
        ValiDate = in.readString();
        LowPrice = in.readString();
        SalePrice = in.readString();
        CMemo = in.readString();
        RUserID = in.readInt();
        CompanyID = in.readString();
        IndustryType = in.readString();
        MainTypes = in.readString();
        Cstate = in.readString();
        RemainDay = in.readString();
        FullReduce = in.readString();
        Label = in.readString();
        AppointMent = in.readString();
        CardNo = in.readString();
        ReceiveStatu = in.readString();
    }

    public static final Creator<CouponModel> CREATOR = new Creator<CouponModel>() {
        @Override
        public CouponModel createFromParcel(Parcel in) {
            return new CouponModel(in);
        }

        @Override
        public CouponModel[] newArray(int size) {
            return new CouponModel[size];
        }
    };

    public CouponModel(String lowPrice, String fullReduce, String receiveStatu) {
        LowPrice = lowPrice;
        FullReduce = fullReduce;
        ReceiveStatu = receiveStatu;
    }

    public CouponModel() {
    }

    public boolean isCheck() {
        return isCheck;
    }

    public void setCheck(boolean check) {
        isCheck = check;
    }

    public String getID() {
        return ID;
    }

    public void setID(String ID) {
        this.ID = ID;
    }

    public String getPicUrl() {
        return PicUrl;
    }

    public void setPicUrl(String PicUrl) {
        this.PicUrl = PicUrl;
    }

    public String getCardName() {
        return CardName;
    }

    public void setCardName(String CardName) {
        this.CardName = CardName;
    }

    public String getValiDate() {
        return ValiDate;
    }

    public void setValiDate(String ValiDate) {
        this.ValiDate = ValiDate;
    }

    public String getLowPrice() {
        if (TextUtils.isEmpty(LowPrice)) {
            return "0";
        }
        return MyUtils.subZeroAndDot(LowPrice);
    }

    public void setLowPrice(String LowPrice) {
        this.LowPrice = LowPrice;
    }

    public String getSalePrice() {
        if (TextUtils.isEmpty(SalePrice)) {
            return "0";
        }
        return MyUtils.subZeroAndDot(SalePrice);
    }

    public void setSalePrice(String SalePrice) {
        this.SalePrice = SalePrice;
    }

    public String getCMemo() {
        if(TextUtils.isEmpty(CMemo)){
            return "";
        }
        return CMemo;
    }

    public void setCMemo(String CMemo) {
        this.CMemo = CMemo;
    }

    public int getRUserID() {
        return RUserID;
    }

    public void setRUserID(int RUserID) {
        this.RUserID = RUserID;
    }

    public String getCompanyID() {
        return CompanyID;
    }

    public void setCompanyID(String CompanyID) {
        this.CompanyID = CompanyID;
    }

    public String getIndustryType() {
        return IndustryType;
    }

    public void setIndustryType(String IndustryType) {
        this.IndustryType = IndustryType;
    }

    public String getMainTypes() {
        return MainTypes;
    }

    public void setMainTypes(String MainTypes) {
        this.MainTypes = MainTypes;
    }

    public String getCstate() {
        if(TextUtils.isEmpty(Cstate)){
            return "0";
        }
        return Cstate;
    }

    public void setCstate(String Cstate) {
        this.Cstate = Cstate;
    }

    public String getRemainDay() {
        return RemainDay;
    }

    public void setRemainDay(String RemainDay) {
        this.RemainDay = RemainDay;
    }

    public String getFullReduce() {
        if (TextUtils.isEmpty(FullReduce)) {
            return "0";
        }
        return MyUtils.subZeroAndDot(FullReduce);
    }

    public void setFullReduce(String FullReduce) {
        this.FullReduce = FullReduce;
    }

    public String getLabel() {
        return Label;
    }

    public void setLabel(String Label) {
        this.Label = Label;
    }

    public String getAppointMent() {
        return AppointMent;
    }

    public void setAppointMent(String AppointMent) {
        this.AppointMent = AppointMent;
    }

    public String getCardNo() {
        return CardNo;
    }

    public void setCardNo(String CardNo) {
        this.CardNo = CardNo;
    }

    public String getReceiveStatu() {
        return ReceiveStatu;
    }

    public void setReceiveStatu(String ReceiveStatu) {
        this.ReceiveStatu = ReceiveStatu;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(ID);
        dest.writeString(PicUrl);
        dest.writeString(CardName);
        dest.writeString(ValiDate);
        dest.writeString(LowPrice);
        dest.writeString(SalePrice);
        dest.writeString(CMemo);
        dest.writeInt(RUserID);
        dest.writeString(CompanyID);
        dest.writeString(IndustryType);
        dest.writeString(MainTypes);
        dest.writeString(Cstate);
        dest.writeString(RemainDay);
        dest.writeString(FullReduce);
        dest.writeString(Label);
        dest.writeString(AppointMent);
        dest.writeString(CardNo);
        dest.writeString(ReceiveStatu);
    }
}
